import request from '@/utils/request'

// 查询通知列表 - 分页
export function noticePages(query) {
    return request({
        url: '/as/asNotice/queryNoticeByPage',
        method: 'get',
        params: query
    })
}

// 发布通知
export function createNotice(data) {
    return request({
        url: '/as/asNotice/newOneNotice',
        method: 'post',
        data: data
    })
}

// 通知编辑
export function editNotice(data) {
    return request({
        url: '/as/asNotice/updateNotice',
        method: 'put',
        data: data
    })
}

// 查询通知详情
export function noticeDetail(query) {
    return request({
        url: '/as/asNotice/queryNoticeById',
        method: 'get',
        params: query
    })
}

// 切换置顶状态
export function changeNoticeState(data) {
    return request({
        url: '/as/asNotice/updateTopStatus',
        method: 'put',
        data: data
    })
}

// 批量删除通知
export function removeNotices(data) {
    return request({
        url: '/as/asNotice/deleteNoticeById',
        method: 'delete',
        data: data
    })
}

// 编辑通知类型
export function editNoticeType(data) {
    return request({
        url: '/system/dict/data/saveSysDictData',
        method: 'post',
        data: data
    })
}

// 编辑通知类型
export function checkNoticeType(query) {
    return request({
        url: '/as/asNotice/getNoticeTypeUseBoolean',
        method: 'get',
        params: query
    })
}

// 获取通知数量统计
export function tabsStatistics(query) {
    return request({
        url: '/as/asNotice/countAsNotice',
        method: 'get',
        params: query
    })
}

// 获取已读/未读人员列表
export function getReadStateUserList(query) {
    return request({
        url: '/as/asNoticeUser/queryNoticeUserByList',
        method: 'get',
        params: query
    })
}